﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Com.CMS263.BLL;
using Com.CMS263.Util;
using Com.CMS263.PO;

namespace Com.CMS263.Web.manage.MessageManage
{
    public partial class action : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            ReservationBLL rbll = new ReservationBLL();
            string op = StringUtil.checkStr(Request["op"]);
            if (op.ToLower() == "yuyue")
            {
                int id = Convert.ToInt32(Request["id"]);
                if (rbll.Delete("Reservation", id))
                {
                    Response.Write("ok");
                }
                else
                {
                    Response.Write("fail");
                }
            }
            else if (op.ToLower() == "reg")
            {
                int id = Convert.ToInt32(Request["id"]);
                if (rbll.Delete("Reg", id))
                {
                    Response.Write("ok");
                }
                else
                {
                    Response.Write("fail");
                }
            }
            else if (op.ToLower() == "peixun")
            {
                int id = Convert.ToInt32(Request["id"]);
                if (rbll.Delete("Peixun", id))
                {
                    Response.Write("ok");
                }
                else
                {
                    Response.Write("fail");
                }
            }
            else
            {
                int id = int.Parse(Request["id"]);
                MessageBLL bll = new MessageBLL();


                if (bll.Delete("Message", id))
                {

                    Response.Write("ok");
                }
                else
                {
                    Response.Write("fail");
                }
            }
        }
    }
}
